import java.util.Arrays;

/**
 * @Author 12629
 * @Description：
 */
public class Test {


    public static void main(String[] args) {
        Date date1 = new Date();
        date1.printDate();

        System.out.println("==============");
        Date date2 = new Date(2024,7,18);
        date2.printDate();

    }



    public static void main7(String[] args) {
       /* int a;
        System.out.println(a);*/

        Date date1 = new Date();
        //date1.setDate(2024,7,13);
        date1.printDate();



    }



    public static void main6(String[] args) {
        Date date1 = new Date();
        date1.setDate(2024,7,13);
        date1.printDate();


        Date date2 = new Date();
        date2.setDate(2023,7,13);
        date2.printDate();

    }

    public static void main5(String[] args) {

        //Student stu = new Student();

        Dog dog = new Dog();
        dog.name = "小黑";
        dog.color = "黑色";
        dog.bark();
        dog.wag();

        Dog dog2 = new Dog();
        dog2.name = "小飞飞";
        dog2.color = "白色";
        dog2.bark();
        dog2.wag();


       /* Dog dog3 = new Dog();
        Dog dog4 = new Dog();


        int a = 10;*/
    }




















    public static void main4(String[] args) {
        //二维数组 这里可以省略列
        int[][] array = new int[2][];
        array[0] = new int[3];
        array[1] = new int[5];
        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }
    }

    public static void main3(String[] args) {
        int[][] array = {{1,2,3},{4,5,6}};
        int[][] array2 = new int[][] {{1,2,3},{4,5,6}};
        int[][] array3 = new int[2][3];

        for (int i = 0; i < array.length; i++) {
            for (int j = 0; j < array[i].length; j++) {
                System.out.print(array[i][j]+" ");
            }
            System.out.println();
        }


    }




    public static int[] func1(int[] array) {
        //array = new int[10];
        int[] tmp = new int[array.length];
        for (int i = 0; i < array.length; i++) {
            tmp[i] = array[i] * 2;
        }
        return tmp;
    }

    public static void func3(int[] array) {
        int left = 0;
        int right = array.length-1;
        while (left < right) {
            while (left < right && array[left] % 2 != 0) {
                left++;
            }
            while (left < right && array[right] % 2 == 0) {
                right--;
            }
            swap(array,left, right);
        }
    }
    public static void swap(int[] array,int i,int j) {
        int tmp = array[i];
        array[i] = array[j];
        array[j] = tmp;
    }

    public static int[] func4(int[] array,int target) {
        int[] tmp = new int[]{-1,-1};
        for (int i = 0; i < array.length-1; i++) {
            for (int j = i+1; j < array.length; j++) {
                if(array[i] + array[j] == target) {
                    tmp[0] = i;
                    tmp[1] = j;
                }
            }
        }
        return tmp;
    }

    public static int func5(int[] array) {
        int ret = 0;
        for (int i = 0; i < array.length; i++) {
            ret ^= array[i];
        }
        return ret;
    }

    public static int func6(int[] array) {
        Arrays.sort(array);
        return array[array.length/2];
    }

    /**
     * 是否存在连续的三个奇数
     * @param array
     * @return
     */
    public static boolean func7(int[] array) {
        int count = 0;
        for (int i = 0; i < array.length; i++) {
            if(array[i] % 2 != 0) {
                count++;
                //立即判断
                if(count == 3) {
                    return true;
                }
            }else {
                count = 0;
            }
        }
        return false;
    }

    public static int func8(int... array) {
        int sum = 0;
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        return sum;
    }

    public static void main2(String[] args) {
        func8(1);
        func8(1,2,3,4,5,6,7,8);
        int[] array = {1,3,4,5,6,7,8,9,0,8,7,6,5,4,3,1};
        System.out.println(func8(array));
    }

    public static void main1(String[] args) {
        int[] array = {1,2,3,5,1};
        boolean ret = func7(array);
        System.out.println(ret);

        /*int[] array = {2,7,11,15};
        int[] tmp = func4(array,9);
        System.out.println(Arrays.toString(tmp));*/

        /*int[] array = {1,2,3,4};
        System.out.println(Arrays.toString(array));
        int[] ret = func1(array);
        System.out.println("array:: "+Arrays.toString(array));
        System.out.println("ret:: "+Arrays.toString(ret));
*/
        /*int[] array = {1,2,3,4};
        System.out.println(Arrays.toString(array));
        func2(array);
        System.out.println(Arrays.toString(array));*/
    }

    public static void func2(int[] array) {
        //array[0] = 99;
        for (int i = 0; i < array.length; i++) {
            array[i] = array[i] * 2;
        }
    }




}
